# Maintainer: Daurnimator <daurnimator@archlinux.org>

pkgname=('lua-lpeg-patterns' 'lua51-lpeg-patterns' 'lua52-lpeg-patterns' 'lua53-lpeg-patterns')
pkgver=0.5
pkgrel=1
arch=('any')
url='https://github.com/daurnimator/lpeg_patterns'
license=('MIT')
source=("$pkgname-$pkgver.tar.gz::https://github.com/daurnimator/lpeg_patterns/archive/v$pkgver.tar.gz")
sha256sums=('d1fabf897024822eb2544fd811fc80b85655972804511b9fd8cfea377fb16e0e')

package_lua-lpeg-patterns() {
	pkgdesc='A collection of LPEG patterns for Lua 5.4'
	depends=('lua-lpeg')

	cd "lpeg_patterns-$pkgver"
	install -Dm644 lpeg_patterns/* -t "$pkgdir/usr/share/lua/5.4/lpeg_patterns/"
	install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_lua51-lpeg-patterns() {
	pkgdesc='A collection of LPEG patterns for Lua 5.1'
	depends=('lua51-lpeg')

	cd "lpeg_patterns-$pkgver"
	install -Dm644 lpeg_patterns/* -t "$pkgdir/usr/share/lua/5.1/lpeg_patterns/"
	install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_lua52-lpeg-patterns() {
	pkgdesc='A collection of LPEG patterns for Lua 5.2'
	depends=('lua52-lpeg')

	cd "lpeg_patterns-$pkgver"
	install -Dm644 lpeg_patterns/* -t "$pkgdir/usr/share/lua/5.2/lpeg_patterns/"
	install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_lua53-lpeg-patterns() {
	pkgdesc='A collection of LPEG patterns for Lua 5.3'
	depends=('lua53-lpeg')

	cd "lpeg_patterns-$pkgver"
	install -Dm644 lpeg_patterns/* -t "$pkgdir/usr/share/lua/5.3/lpeg_patterns/"
	install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
